home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 March / macformat-035.iso / CodeWarrior Lite 1.4 / MacOS Support / Headers / Universal Headers / GXMessages.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-06  |  3.6 KB  |  156 lines  |  [TEXT/CWIE]

  1. /*
  2.      File:        GXMessages.h
  3.  
  4.      Contains:    This file contains all of the public data structures,
  5.  
  6.      Version:    Technology:    Quickdraw GX 1.1
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __GXMESSAGES__
  21. #define __GXMESSAGES__
  22.  
  23.  
  24. #ifndef __CONDITIONALMACROS__
  25. #include <ConditionalMacros.h>
  26. #endif
  27.  
  28. #ifndef __MIXEDMODE__
  29. #include <MixedMode.h>
  30. #endif
  31. /*    #include <Types.h>                                            */
  32.  
  33. #ifndef __TYPES__
  34. #include <Types.h>
  35. #endif
  36.  
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40.  
  41. #if PRAGMA_ALIGN_SUPPORTED
  42. #pragma options align=mac68k
  43. #endif
  44.  
  45. #if PRAGMA_IMPORT_SUPPORTED
  46. #pragma import on
  47. #endif
  48.  
  49. #if defined(__MWERKS__) && GENERATING68K
  50.     #pragma push
  51.     #pragma pointers_in_D0
  52. #endif
  53.  
  54. /*
  55.  
  56.     >>>>>> CONSTANTS <<<<<<
  57.  
  58. */
  59. /* Message Manager Trap */
  60.  
  61. enum {
  62.     messageManagerTrap            = 0xABFB
  63. };
  64.  
  65. /* Message Manager Gestalt Selector */
  66. enum {
  67.     gestaltMessageMgrVersion    = 'mess'
  68. };
  69.  
  70. /* Message Manager Error Result Codes */
  71. enum {
  72.     messageStopLoopingErr        = -5775,
  73.     cantDeleteRunningHandlerErr    = -5776,
  74.     noMessageTableErr            = -5777,
  75.     dupSignatureErr                = -5778,
  76.     messageNotReceivedErr        = -5799
  77. };
  78.  
  79. typedef void (*MessageGlobalsInitProcPtr)(void *messageGlobals);
  80.  
  81. #if GENERATINGCFM
  82. typedef UniversalProcPtr MessageGlobalsInitUPP;
  83. #else
  84. typedef MessageGlobalsInitProcPtr MessageGlobalsInitUPP;
  85. #endif
  86.  
  87. enum {
  88.     uppMessageGlobalsInitProcInfo = kCStackBased
  89.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(void*)))
  90. };
  91.  
  92. #if GENERATINGCFM
  93. #define NewMessageGlobalsInitProc(userRoutine)        \
  94.         (MessageGlobalsInitUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppMessageGlobalsInitProcInfo, GetCurrentArchitecture())
  95. #else
  96. #define NewMessageGlobalsInitProc(userRoutine)        \
  97.         ((MessageGlobalsInitUPP) (userRoutine))
  98. #endif
  99.  
  100. #if GENERATINGCFM
  101. #define CallMessageGlobalsInitProc(userRoutine, messageGlobals)        \
  102.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppMessageGlobalsInitProcInfo, (messageGlobals))
  103. #else
  104. #define CallMessageGlobalsInitProc(userRoutine, messageGlobals)        \
  105.         (*(userRoutine))((messageGlobals))
  106. #endif
  107.  
  108. typedef MessageGlobalsInitProcPtr MessageGlobalsInitProc;
  109.  
  110. /*
  111.  
  112.     PUBLIC INTERFACES
  113.  
  114.     Message Handler API Routines
  115. */
  116. extern long CountMessageHandlerInstances(void)
  117.  TWOWORDINLINE(0x7028, 0xABFB);
  118. extern void *GetMessageHandlerClassContext(void)
  119.  TWOWORDINLINE(0x7029, 0xABFB);
  120. extern void *SetMessageHandlerClassContext(void *anyValue)
  121.  TWOWORDINLINE(0x702A, 0xABFB);
  122. extern void *GetMessageHandlerInstanceContext(void)
  123.  TWOWORDINLINE(0x702B, 0xABFB);
  124. extern void *SetMessageHandlerInstanceContext(void *anyValue)
  125.  TWOWORDINLINE(0x702C, 0xABFB);
  126. extern OSErr NewMessageGlobals(long messageGlobalsSize, MessageGlobalsInitUPP initProc)
  127.  TWOWORDINLINE(0x702D, 0xABFB);
  128. extern void DisposeMessageGlobals(void)
  129.  TWOWORDINLINE(0x702E, 0xABFB);
  130. #if !GENERATINGPOWERPC
  131. extern OSErr SendMessage(long messageSelector, ...)
  132.  FOURWORDINLINE(0x221F, 0x7032, 0xABFB, 0x598F);
  133. extern OSErr ForwardMessage(long messageSelector, ...)
  134.  FOURWORDINLINE(0x221F, 0x7035, 0xABFB, 0x598F);
  135. extern OSErr ForwardThisMessage(void)
  136.  TWOWORDINLINE(0x7036, 0xABFB);
  137. #endif
  138.  
  139. #if defined(__MWERKS__) && GENERATING68K
  140.     #pragma pop
  141. #endif
  142.  
  143. #if PRAGMA_IMPORT_SUPPORTED
  144. #pragma import off
  145. #endif
  146.  
  147. #if PRAGMA_ALIGN_SUPPORTED
  148. #pragma options align=reset
  149. #endif
  150.  
  151. #ifdef __cplusplus
  152. }
  153. #endif
  154.  
  155. #endif /* __GXMESSAGES__ */
  156.